/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interact;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author Ngoc Giang
 */
public class iCheckForm {

    public static boolean checkPassword(String Value) {
        Pattern pattern = Pattern.compile("\\W+");
        Matcher matcher = pattern.matcher(Value);
        if (!matcher.find()) {
            return false;
        } else {
            return true;
        }
    }
    //method to check numeric
    public static boolean checkNumber(String Value) {
        Pattern pattern = Pattern.compile("\\D+");
        Matcher matcher = pattern.matcher(Value);
        if (!matcher.find()) {
            return false;
        } else {
            return true;
        }
    }
//    public static boolean isNumeric(String str) {
//        String validChars = "0123456789";
//        boolean isNumber = true;
//        char Char;
//        for (int i = 0; i < str.length() && isNumber == true; i++) {
//            Char = str.charAt(i);
//            if (validChars.indexOf(Char) == -1) {
//                isNumber = false;
//            }
//        }
//        return isNumber;
//    }
}
